package com.example.mapper;

import com.example.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

/*desc:
* author:maoyinjie
* datetime:2023-11-9
* */
@Mapper
public interface UserMapper {
    //更新用户信息
    void updateByUser(User user);
    //添加用户
    @Insert("insert into t_sys_user(login_name,password,gender,birthday,phone,email,status) value" +
            "(#{loginName}, #{password}, #{gender}, #{birthday}, #{phone}, #{email}, #{status})")
    void insertUser(User user);

    //根据ID删除用户

    void deleteById(Integer id);

    //根据ID查询单个用户
    @Select("select * from t_sys_user where id = #{id}")
    User queryById(Integer id);

    //查询用户列表
    @Select("select * from t_sys_user")
    List<User> list();

    //根据名字查询用户
    @Select("select * from t_sys_user where login_name = #{loginName}")
    User queryByName(String loginName);

    //批量导入用户
   void importUser(@Param("list1") List<User> list1);


}
